<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
</head>
<body>
    <div id="app">
        <div>{{xing}}-{{name}}</div>
        <div>{{fullname}}</div>
        <div>{{names()}}</div>
        <div>{{ages}}</div>
        <div>{{agas()}}</div>
        <button @click = "age++">加</button>
    </div>
</body>
</html>
<script>
    const app = Vue.createApp({
        data(){
            return{
                xing:'li',
                name:'ming',
                age:18
            }          
        },
        computed:{
            fullname(){
                return this.xing + '' + this.name
            },
            ages(){
                return this.age + '' + this.age
            }
        },
        methods:{
            names(){
                return this.xing + this.name
            },
            agas(){
                return this.age + '' + this.age
            }
        }
    }).mount('#app')
</script>